<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/WEB-INF/jsp/include/easyui_1_5_3.jsp"%>
<SCRIPT src="${path}/js/index/Clock.js" type=text/javascript></SCRIPT>
<title>药店管理系统</title>

<script type="text/javascript">
	$(function() {
		$('#mainMenu').tree({
			url : path+'/getMenu',
			parentField : 'pid',
			//data: [{"attributes":{},"checked":false,"children":[{"attributes":{},"checked":false,"children":[],"id":"user","pid":"system","state":"open","text":"用户管理"}],"id":"system","pid":"0","state":"open","text":"系統管理"}],
// 			loadFilter : function(data, parent){
// 				alert(JSON.stringify( data ));
// 				if (data.d){
// 					return data.d;
// 				} else {
// 					return data;
// 				}
// 			},
			onClick : function(node) {
// 				alert(node.attributes.url);
				if (node.attributes.url) {
					var src = path + node.attributes.url;
					if (!$.startWith(node.attributes.url, '/')) {	//不是本项目的url，例如www.baidu.com
						src = node.attributes.url;
					}
					var tabs = $('#mainTabs');
					var opts = {
						title : node.text,
						closable : true,
						iconCls : node.iconCls,
						content : $.formatString('<iframe src="{0}" allowTransparency="true" style="border:0;width:99%;height:99%;padding-left:2px;" frameBorder="0"></iframe>', src),
						border : false,
						fit : true
					};
					if (tabs.tabs('exists', opts.title)) {
						tabs.tabs('select', opts.title);
					} else {
						tabs.tabs('add', opts);
					}
				}
			}
		});
	})
	function treeReload(){
		$('#mainMenu').tree("reload");
	}
	function zhankai(){
		$('#mainMenu').tree("expandAll");
	}
	function zhedie(){
		$('#mainMenu').tree("collapseAll");
	}
</script>

</head>
<body  class="easyui-layout">

	<!-- 头部 -->
	<div data-options="region:'north'" style="height:60px;background:#B0C4DE;padding:0px;overflow-y:hidden">
		<div style="font-size:20px;">
			<strong><SPAN style="color: blue;font-size:30px;">药&nbsp;店&nbsp;管&nbsp;理&nbsp;系&nbsp;统</SPAN></strong>
		</div>
        <div id="sessionInfoDiv" style="position: absolute;right: 5px;top:10px;">
            <strong><%=user.getUser_name() %></SPAN></strong>&nbsp;欢迎你！
            <SPAN id=clock style="color: blue;"></SPAN>
			<SCRIPT type=text/javascript> 
			    var clock = new Clock();
			    clock.display(document.getElementById("clock"));
			</SCRIPT>
        </div>
		<div style="position: absolute; right: 0px; bottom: 0px; ">
		    <a href="javascript:void(0);" class="easyui-menubutton" data-options="menu:'#layout_north_pfMenu',iconCls:'icon-ok'">更换皮肤</a>
		    <a href="javascript:void(0);" class="easyui-menubutton" data-options="menu:'#layout_north_kzmbMenu',iconCls:'icon-help'">控制面板</a>
		    <a href="javascript:void(0);" class="easyui-menubutton" data-options="menu:'#layout_north_zxMenu',iconCls:'icon-back'">注销</a>
		</div>
		
		<div id="layout_north_pfMenu" style="width: 120px; display: none;">
		    <div onclick="changeTheme('default');">默认</div>
		</div>
		<div id="layout_north_kzmbMenu" style="width: 100px; display: none;">
		    <div onclick="userInfoFun();">个人信息</div>
		</div>
		<div id="layout_north_zxMenu" style="width: 100px; display: none;">
		    <div onclick="logout();">重新登录</div>
		    <div class="menu-sep"></div>
		    <div onclick="logoutClose(true);">退出系统</div>
		</div>

	</div>
	<!-- 右侧菜单 -->
<!--         <div data-options="region:'west',href:''" title="导航菜单" style="width: 200px; padding: 0px;"> -->
	<div data-options="region:'west',split:true,href:''"" title="导航菜单" style="width:200px ;height:1000px;">
		<div style="padding:5px;background:#fafafa;width:500px;border:1px solid #ccc">
			<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-reload" onclick="treeReload()">刷新</a>
			<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-add" onclick="zhankai();">展开</a>
			<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-remove" onclick="zhedie()">折叠</a>
		</div>
		<ul id="mainMenu" >
		</ul>
<!-- 		<div class="easyui-accordion" data-options="fit:true,border:false"> -->
<!-- 			<div title="菜单管理" data-options="selected:true" style="padding:10px;"> -->
<!-- 				content1 -->
<!-- 			</div> -->
<!-- 		</div> -->
	</div>
	<!-- 中间主菜单 -->
	<div data-options="region:'center',iconCls:'icon-ok'">
		<div class="easyui-tabs" id="mainTabs" data-options="fit:true,border:false,plain:true">
			<div title="欢迎使用" style="padding:10px">
				<h1 style="font-size:24px;">欢迎使用项目管理系统</h1>
			</div>
		</div>
	</div>
	<!-- 脚部 -->
	<div data-options="region:'south'" style="height:24px;"></div>
	<!-- 左侧 -->
<!-- 	<div data-options="region:'east',split:true" title="East" style="width:180px;"> -->
<!-- 		<ul class="easyui-tree" data-options="url:'tree_data1.json',method:'get',animate:true,dnd:true"></ul> -->
<!-- 	</div> -->
</body>
</html>